
import pdfplumber

filePath = './test.pdf'
with pdfplumber.open(filePath) as pdf:
    for i, page in enumerate(pdf.pages):
        im = page.to_image(resolution=72)
        im.save(r'page-{}.png'.format(i + 1))